package com.lingz.manager.modules.wuxue.serviceimpl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.lingz.manager.base.DevplatBaseDao;
import com.lingz.manager.modules.wuxue.dao.TownGovInfoDao;
import com.lingz.manager.modules.wuxue.mapper.TownGovInfoMapper;
import com.lingz.manager.modules.wuxue.entity.TownGovInfo;
import com.lingz.manager.modules.wuxue.service.TownGovInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Slf4j
@Service
@Transactional
public class TownGovInfoServiceImpl implements TownGovInfoService {
    @Autowired
    TownGovInfoDao townGovInfoDao;

    @Autowired
    TownGovInfoMapper townGovInfoMapper;
    @Override
    public DevplatBaseDao<TownGovInfo, String> getRepository() {
        return townGovInfoDao;
    }

    @Override
    public List<TownGovInfo> findListTownGovInfo(TownGovInfo townGovInfo) {
        LambdaQueryWrapper<TownGovInfo> wrapper = Wrappers.lambdaQuery(TownGovInfo.class);
        List<TownGovInfo> list = townGovInfoMapper.selectList(wrapper);
        return list;
    }

    @Override
    public TownGovInfo findTownGovInfoById(int id) {
        return townGovInfoMapper.selectById(id);
    }
}
